package com.nuoniu.sibanyun.entity.finance;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.nuoniu.sibanyun.common.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 * 会计凭证细表
 * </p>
 *
 * @author 小啊刚
 * @since 2021-04-09
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("fag_voucher_entry")
@ApiModel(value = "VAccountingVoucherDetail对象", description = "会计凭证细表")
public class VAccountingVoucherDetail extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主单据id")
    @TableField("order_id")
    private Integer orderId;

    @ApiModelProperty(value = "账套id")
    @TableField("account_id")
    private Integer accountId;

    @ApiModelProperty(value = "会计年份")
    @TableField("account_year")
    private Integer accountYear;

    @ApiModelProperty(value = "账套期间")
    @TableField("account_period")
    private Integer accountPeriod;

    @ApiModelProperty(value = "公司id")
    @TableField("company_id")
    private Integer companyId;

    @ApiModelProperty(value = "摘要")
    @TableField("description")
    private String description;
//    @ApiModelProperty(value = "摘要")
//    @TableField("remark")
//    private String remark;

    @ApiModelProperty(value = "会计科目id")
    @TableField("accounting_id")
    private Integer accountingId;

    @ApiModelProperty(value = "会计科目名称")
    @TableField("accounting_name")
    private String accountingName;

    @ApiModelProperty(value = "会计科目编码")
    @TableField("accounting_code")
    private String accountingCode;

    @ApiModelProperty(value = "会计科目描述")
    @TableField("accounting_remark")
    private String accountingRemark;

    @ApiModelProperty(value = "创建日期")
    @TableField("create_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
    private LocalDate createDate;

    @ApiModelProperty(value = "币种ID(外币核算)")
    @TableField("currency_id")
    private Integer currencyId;

    @ApiModelProperty(value = "币种名称(外币核算)")
    @TableField("currency_name")
    private String currencyName;

    @ApiModelProperty(value = "外币金额(外币核算)")
    @TableField("currency_amount")
    private BigDecimal currencyAmount;

    @ApiModelProperty(value = "汇率(外币核算)")
    @TableField("exchange_rate")
    private BigDecimal exchangeRate;

    @ApiModelProperty(value = "数量(数量核算)")
    @TableField("quantity")
    private BigDecimal quantity;

    @ApiModelProperty(value = "计量单位id(数量核算)")
    @TableField("unit_id")
    private Integer unitId;

    @ApiModelProperty(value = "计量单位名称(数量核算)")
    @TableField("unit_name")
    private String unitName;

    @ApiModelProperty(value = "单价(数量核算)")
    @TableField("price")
    private BigDecimal price;

    @ApiModelProperty(value = "辅助项名称")
    @TableField("auxiliary_item")
    private String auxiliaryItem;

    @ApiModelProperty(value = "部门id")
    @TableField("office_id")
    private Integer officeId;

    @ApiModelProperty(value = "部门名称")
    @TableField("office_name")
    private String officeName;

    @ApiModelProperty(value = "人个/用户id")
    @TableField("employee_id")
    private Integer employeeId;

    @ApiModelProperty(value = "个人/用户名称")
    @TableField("employee_name")
    private String employeeName;

//    @ApiModelProperty(value = "人个/用户id")
//    @TableField("user_id")
//    private Integer userId;
//
//    @ApiModelProperty(value = "个人/用户名称")
//    @TableField("user_name")
//    private String userName;

    @ApiModelProperty(value = "客户id")
    @TableField("customer_id")
    private Integer customerId;

    @ApiModelProperty(value = "客户名称")
    @TableField("customer_name")
    private String customerName;
//    @ApiModelProperty(value = "客户id")
//    @TableField("crm_id")
//    private Integer crmId;
//
//    @ApiModelProperty(value = "客户名称")
//    @TableField("crm_name")
//    private String crmName;

    @ApiModelProperty(value = "供应商名称")
    @TableField("vendor_id")
    private Integer vendorId;

    @ApiModelProperty(value = "供应商名称")
    @TableField("vendor_name")
    private String vendorName;

    @ApiModelProperty(value = "项目id")
    @TableField("project_id")
    private Integer projectId;

    @ApiModelProperty(value = "项目名称")
    @TableField("project_name")
    private String projectName;

    @ApiModelProperty(value = "银行账户id(现金银行核算)")
    @TableField("bank_id")
    private Integer bankId;

    @ApiModelProperty(value = "银行账号(现金银行核算)")
    @TableField("bank_account")
    private String bankAccount;

    @ApiModelProperty(value = "开户行名称(现金银行核算)")
    @TableField("bank_name")
    private String bankName;

    @ApiModelProperty(value = "结算方式id(现金银行核算)")
    @TableField("settle_id")
    private Integer settleId;

    @ApiModelProperty(value = "结算方式名称(现金银行核算)")
    @TableField("settle_name")
    private String settleName;

    @ApiModelProperty(value = "票据号(现金银行核算)")
    @TableField("bill_no")
    private String billNo;

    @ApiModelProperty(value = "票据日期(现金银行核算)")
    @TableField("bill_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
    private LocalDate billDate;

    @ApiModelProperty(value = "业务单据")
    @TableField("business_bill")
    private String businessBill;

    @ApiModelProperty(value = "业务日期")
    @TableField("business_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
    private LocalDate businessDate;

    @ApiModelProperty(value = "到期日期")
    @TableField("expire_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
    private LocalDate expireDate;

    @ApiModelProperty(value = "借方金额")
    @TableField(value = "debit_amount", updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal debitAmount;

    @ApiModelProperty(value = "贷方金额")
    @TableField(value = "credit_amount", updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal creditAmount;
}
